class UserInfo {
  final String username;
  final String sex;
  final String avatar;
  final String imId;

  UserInfo({
    required this.username,
    required this.sex,
    required this.avatar,
    required this.imId,
  });
  factory UserInfo.fromJson(Map<String, dynamic> json) {
    return UserInfo(
      username: json['username'] ?? '',
      sex: json['sex'] ?? '',
      avatar: json['avatar'] ?? '',
      imId: json['im_id'].toString(),
    );
  }
  Map<String, dynamic> toJson() {
    return {
      'username': username,
      'sex': sex,
      'avatar': avatar,
      'im_id': imId,
    };
  }
}